<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<h2>基本类型数据绑定</h2>
<a href="/base?id=1&username=张三&score=10.0&birthday=2020-01-01&sex=1">请求携带数据-基本类型</a>
<hr>
<form action="/base" method="get">
    id<input type="text" name="id"><br>
    username<input type="text" name="username"><br>
    score<input type="text" name="score"><br>
    birthday<input type="date" name="birthday"><br>
    sex<input type="radio" name="sex" value="1">男
    <input type="radio" name="sex" value="2">女<br>
    <input type="submit" value="基本类型">
</form>
<h2>基本类型数据绑定</h2>
<a href="/base2?id=1&username=张三&score=10.0&birthday=2020-01-01&sex=1">请求携带数据-基本类型</a>
<hr>
<form action="/base2" method="get">
    id<input type="text" name="id"><br>
    username<input type="text" name="username"><br>
    score<input type="text" name="score"><br>
    birthday<input type="date" name="birthday"><br>
    sex<input type="radio" name="sex" value="1">男
    <input type="radio" name="sex" value="2">女<br>
    <input type="submit" value="基本类型">
</form>
<!--演示使用axios 发送post请求，且是json数据到后端-->
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<button id="btn">点击-aixos发送</button>
<script>
    var btn = document.getElementById("btn");
    btn.onclick=function (){
        console.log("点击事件生效")
        // axios发送post请求
        axios.post('/obj2', {
            id: 2,
            username: '奥特曼',
            password: '123123',
            score:59.9,
            birthday:"2000-01-01",
            sex:1
        }).then(function (response) {
            console.log(response);
        }).catch(function (error) {
            console.log(error);
        });
    }
</script>
<h2>数组绑定</h2>
<form action="/array" method="get">
    <input type="checkbox" name="ids" value="1">1
    <input type="checkbox" name="ids" value="2">2
    <input type="checkbox" name="ids" value="3">3
    <input type="checkbox" name="ids" value="4">4
    <input type="submit" value="数组类型">
</form>

<h2>集合list绑定</h2>
<form action="/arraylist" method="get">
    <input type="checkbox" name="ids" value="1">1
    <input type="checkbox" name="ids" value="2">2
    <input type="checkbox" name="ids" value="3">3
    <input type="checkbox" name="ids" value="4">4
    <input type="submit" value="数组类型">
</form>

<h2>演示: 接收Map类型的数据</h2>
<form action="/receiveMap">
    用户名<input type="text" name="username"><br>
    年龄<input type="text" name="age"><br>
    分数<input type="text" name="score"><br>
    生日<input type="date" name="birthday"><br>
    <button>提交</button>
</form>

<h2>演示: 接收路径中的数据</h2>
<a href="/blog/weixin_39641494/article/details/131625212">
    查看博客
</a>
